home *** CD-ROM | disk | FTP | other *** search
/ Hacker's Secrets 4 / Hacker's Secrets 4.iso / internet / ipspoofi.txt < prev    next >
Text File  |  1995-07-05  |  12KB  |  253 lines

  1.  
  2. =============================================================================
  3. CA-95:01                         CERT Advisory
  4.                                 January 23, 1995
  5.                 IP Spoofing Attacks and Hijacked Terminal Connections
  6. -----------------------------------------------------------------------------
  7.  
  8. The CERT Coordination Center has received reports of attacks in which
  9. intruders create packets with spoofed source IP addresses. These attacks
  10. exploit applications that use authentication based on IP addresses. This
  11. exploitation leads to user and possibly root access on the targeted system.
  12. Note that this attack does not involve source routing. Recommended solutions
  13. are described in Section III below.
  14.  
  15. In the current attack pattern, intruders may dynamically modify the kernel of
  16. a Sun 4.1.X system once root access is attained.  In this attack, which is
  17. separate from the IP spoofing attack, intruders use a tool to take control of
  18. any open terminal or login session from users on the system. Note that
  19. although the tool is currently being used primarily on SunOS 4.1.x systems,
  20. the system features that make this attack possible are not unique to SunOS.
  21.  
  22. As we receive additional information relating to this advisory, we will place
  23. it, along with any clarifications, in a CA-95:01.README file. CERT advisories
  24. and their associated README files are available by anonymous FTP from
  25. info.cert.org. We encourage you to check the README files regularly for
  26. updates on advisories that relate to your site.
  27.  
  28. -----------------------------------------------------------------------------
  29.  
  30. I.   Description
  31.  
  32.      This description summarizes both the IP spoofing technique that can
  33.      lead to root access on a system and the tool that intruders are using to
  34.      take over open terminal and login connections after they get root access.
  35.      We are currently seeing attacks in which intruders combine IP spoofing
  36.      with use of the tool. However, these are two separate actions. Intruders
  37.      can use IP spoofing to gain root access for any purpose; similarly, they
  38.      can highjack terminal connections regardless of their method of gaining
  39.      root access.
  40.  
  41.      IP spoofing
  42.         To gain access, intruders create packets with spoofed source IP
  43.         addresses. This exploits applications that use authentication based on
  44.         IP addresses and leads to unauthorized user and possibly root access
  45.         on the targeted system. It is possible to route packets through
  46.         filtering-router firewalls if they are not configured to filter
  47.         incoming packets whose source address is in the local domain. It
  48.         is important to note that the described attack is possible even if
  49.         no reply packets can reach the attacker.
  50.  
  51.         Examples of configurations that are potentially vulnerable include
  52.         - routers to external networks that support multiple internal
  53.           interfaces
  54.         - routers with two interfaces that support subnetting on the
  55.           internal network
  56.         - proxy firewalls where the proxy applications use the source
  57.           IP address for authentication
  58.  
  59.         The IP spoofing attacks we are currently seeing are similar to those
  60.         described in two papers: 1) "Security Problems in the TCP/IP Protocol
  61.         Suite" by Steve Bellovin, published in _Computer Communication Review_
  62.         vol. 19, no. 2 (April 1989) pages 32-48; 2) "A Weakness in the 4.2BSD
  63.         Unix TCP/IP Software" by Robert T. Morris. Both papers are available
  64.         by anonymous FTP from
  65.  
  66.            ftp.research.att.com:/dist/internet_security
  67.  
  68.            Bellovin paper: ipext.ps.Z
  69.            Morris paper:   117.ps.Z
  70.  
  71.         Services that are vulnerable to the IP spoofing attack include
  72.            SunRPC & NFS
  73.            BSD UNIX "r" commands
  74.            anything wrapped by the tcp daemon wrappers - site dependent; check
  75.                your configuration
  76.            X windows
  77.            other applications that use source IP addresses for authentication
  78.  
  79.      Hijacking tool
  80.         Once the intruders have root access on a system, they can use a tool
  81.         to dynamically modify the UNIX kernel. This modification allows them
  82.         to hijack existing terminal and login connections from any user on the
  83.         system.
  84.  
  85.         In taking over the existing connections, intruders can bypass one-time
  86.         passwords and other strong authentication schemes by tapping the
  87.         connection after the authentication is complete. For example, a
  88.         legitimate user connects to a remote site through a login or terminal
  89.         session; the intruder hijacks the connection after the user has
  90.         completed the authentication to the remote location; the remote site
  91.         is now compromised. (See Section I for examples of vulnerable
  92.         configurations.)
  93.  
  94.         Currently, the tool is used primarily on SunOS 4.1.x systems. However,
  95.         the system features that make this attack possible are not unique to
  96.         SunOS.
  97.  
  98.  
  99. II. Impact
  100.  
  101.      Current intruder activity in spoofing source IP addresses can lead to
  102.      unauthorized remote root access to systems behind a filtering-router
  103.      firewall.
  104.  
  105.      After gaining root access and taking over existing terminal and login
  106.      connections, intruders can gain access to remote hosts.
  107.  
  108.  
  109. III. Solutions
  110.  
  111.      A. Detection
  112.  
  113.         IP spoofing
  114.            If you monitor packets using network-monitoring software such as
  115.            netlog, look for a packet on your external interface that has
  116.            both its source and destination IP addresses in your local domain.
  117.            If you find one, you are currently under attack. Netlog is
  118.            available by anonymous FTP from
  119.               net.tamu.edu:/pub/security/TAMU/netlog-1.2.tar.gz
  120.               MD5 checksum: 1dd62e7e96192456e8c75047c38e994b
  121.  
  122.            Another way to detect IP spoofing is to compare the process
  123.            accounting logs between systems on your internal network. If
  124.            the IP spoofing attack has succeeded on one of your systems,
  125.            you may get a log entry on the victim machine showing a remote
  126.            access; on the apparent source machine, there will be no
  127.            corresponding entry for initiating that remote access.
  128.  
  129.         Hijacking tool
  130.            When the intruder attaches to an existing terminal or login
  131.            connection, users may detect unusual activity, such as commands
  132.            appearing on their terminal that they did not type or a blank window
  133.            that will no longer respond to their commands. Encourage your users
  134.            to inform you of any such activity. In addition, pay particular
  135.            attention to connections that have been idle for a long time.
  136.  
  137.            Once the attack is completed, it is difficult to detect. However,
  138.            the intruders may leave remnants of their tools. For example, you
  139.            may find a kernel streams module designed to tap into existing TCP
  140.            connections.
  141.  
  142.      B. Prevention
  143.  
  144.         IP spoofing
  145.            The best method of preventing the IP spoofing problem is to install
  146.            a filtering router that restricts the input to your external
  147.            interface (known as an input filter) by not allowing a packet
  148.            through if it has a source address from your internal network. In
  149.            addition, you should filter outgoing packets that have a source
  150.            address different from your internal network in order to prevent
  151.            a source IP spoofing attack originating from your site.
  152.  
  153.            The following vendors have reported support for this feature:
  154.              Bay Networks/Wellfleet routers, version 5 and later
  155.              Cabletron - LAN Secure
  156.              Cisco - RIS software all releases of version 9.21 and later
  157.              Livingston - all versions
  158.  
  159.            If you need more information about your router or about firewalls,
  160.            please contact your vendor directly.
  161.  
  162.            If your vendor's router does not support filtering on the inbound
  163.            side of the interface or if there will be a delay in incorporating
  164.            the feature into your system, you may filter the spoofed IP packets
  165.            by using a second router between your external interface and your
  166.            outside connection. Configure this router to block, on the outgoing
  167.            interface connected to your original router, all packets that have a
  168.            source address in your internal network. For this purpose, you can
  169.            use a filtering router or a UNIX system with two interfaces that
  170.            supports packet filtering.
  171.  
  172.            NOTE: Disabling source routing at the router does not protect you
  173.                  from this attack, but it is still good security practice to
  174.                  do so.
  175.  
  176.         Hijacking tool
  177.            There is no specific way to prevent use of the tool other than
  178.            preventing intruders from gaining root access in the first place.
  179.            If you have experienced a root compromise, see Section C for general
  180.            instructions on how to recover.
  181.  
  182.      C. Recovery from a UNIX root compromise
  183.  
  184.         1. Disconnect from the network or operate the system in
  185.            single-user mode during the recovery.  This will keep users
  186.            and intruders from accessing the system.
  187.  
  188.         2. Verify system binaries and configuration files against the
  189.            vendor's media (do not rely on timestamp information to
  190.            provide an indication of modification).  Do not trust any
  191.            verification tool such as cmp(1) located on the compromised
  192.            system as it, too, may have been modified by the intruder.
  193.            In addition, do not trust the results of the standard UNIX
  194.            sum(1) program as we have seen intruders modify system
  195.            files in such a way that the checksums remain the same.
  196.            Replace any modified files from the vendor's media, not
  197.            from backups.
  198.                                 -- or --
  199.  
  200.            Reload your system from the vendor's media.
  201.  
  202.         3. Search the system for new or modified setuid root files.
  203.  
  204.                 find / -user root -perm -4000 -print
  205.  
  206.            If you are using NFS or AFS file systems, use ncheck to
  207.            search the local file systems.
  208.  
  209.                 ncheck -s /dev/sd0a
  210.  
  211.         4. Change the password on all accounts.
  212.  
  213.         5. Don't trust your backups for reloading any file used by
  214.            root.  You do not want to re-introduce files altered by an
  215.            intruder.
  216.  
  217. ---------------------------------------------------------------------------
  218. The CERT Coordination Center thanks Eric Allman, Steve Bellovin, Keith Bostic,
  219. Bill Cheswick, Mike Karels, and Tsutomu Shimomura for contributing to our
  220. understanding of these problems and their solutions.
  221. ---------------------------------------------------------------------------
  222.  
  223. If you believe that your system has been compromised, contact the CERT
  224. Coordination Center or your representative in Forum of Incident
  225. Response and Security Teams (FIRST).
  226.  
  227. If you wish to send sensitive incident or vulnerability information to
  228. CERT staff by electronic mail, we strongly advise that the e-mail be
  229. encrypted.  The CERT Coordination Center can support a shared DES key, PGP
  230. (public key available via anonymous FTP on info.cert.org), or PEM (contact
  231. CERT staff for details).
  232.  
  233. Internet E-mail: cert@cert.org
  234. Telephone: +1 412-268-7090 (24-hour hotline)
  235.            CERT personnel answer 8:30 a.m.-5:00 p.m. EST(GMT-5)/EDT(GMT-4),
  236.            and are on call for emergencies during other hours.
  237. Fax: +1 412-268-6989
  238.  
  239. CERT Coordination Center
  240. Software Engineering Institute
  241. Carnegie Mellon University
  242. Pittsburgh, PA 15213-3890
  243. USA
  244.  
  245. Past advisories, CERT bulletins, information about FIRST representatives,
  246. and other information related to computer security are available for anonymous
  247. FTP from info.cert.org.
  248.  
  249.  
  250.  
  251. CERT is a service mark of Carnegie Mellon University.
  252.  
  253.